/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.nc.kyiv.yellow.sociallibrary.social;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.Date;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author My
 */


public class GoogleBooks extends OAuthClient {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setContentType("text/html;charset=UTF-8");
        try (PrintWriter out = resp.getWriter()) {

            String urlForBI = "https://www.googleapis.com/books/v1/volumes?q=isbn:" + req.getParameter("isbn");
            String strBI = getStringFromHTMLwithGetMethod(urlForBI);
            //System.out.println(parseJSON(strBI));
            out.print(strBI);
        }
    }

    @Override
    protected String getPureAccessToken(String someString) {
        return null;
    }    
}
